#include <SFML/Graphics.hpp>
#include <cmath>
#include "medusa.hpp"



int main() {
    const unsigned int width = 900;
    const unsigned int height = 900;

    // SFML 3 推荐使用 sf::StyleFlags 而不是旧的 Style 宏
    sf::RenderWindow window(sf::VideoMode({width, height}), "Medusa");
    window.setFramerateLimit(60);

    Medusa medusa(10000);

    double t = 0.0;

    while (window.isOpen()) {
        while (const std::optional event = window.pollEvent())
        {
            if (event->is<sf::Event::Closed>())
                window.close();
        }

        t += 3.1415926 / 20.0;
        if (t > 1e6) t = 0;

        medusa.update(t);

        window.clear(sf::Color::Black);
        medusa.draw(window);
        window.display();
    }

    return 0;
}
